#include <ctype.h>
#include "syntaxparser.h"
#include "strlib.h"
#include "scanadt.h"
#include "commands.h"

void runLine(string line){
	scannerADT scanner;
	string token;

	line = ConvertToUpperCase(line);
	scanner = NewScanner();
	SetScannerString(scanner, line);
	SetScannerSpaceOption(scanner, IgnoreSpaces);

	token = ReadToken(scanner);//linenumber
	token = ReadToken(scanner);//command
	if(StringEqual(token, "LIST") || StringEqual(token, "HELP") || StringEqual(token, "RUN")) Error("Command must be executed directly");

	ExecuteCommand(token, line);
}